package com.hdaccp.foodsales.service.impl;

import com.hdaccp.foodsales.dao.shangpinDao;
import com.hdaccp.foodsales.entity.Shangpin;
import com.hdaccp.foodsales.service.shangpinService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class shangpinServiceimpl implements shangpinService {
    @Autowired
    private shangpinDao shangpinDao;

    @Override
    public Shangpin getsid(int sid) {
        return shangpinDao.getsid(sid);
    }

    @Override
    public List<Shangpin>findAll(String sname,int offset,int limit){
        return shangpinDao.query(sname,offset,limit);
    }

    @Override
    public long findTotalCount(String sname) {
        return shangpinDao.getTotalCount(sname);
    }

}
